package cn.wanho.dao;

import cn.wanho.dto.CmsExamCount;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * @Author: FXP
 * @Date: 2022/08/04/9:48
 * @Description: 
 */
@Mapper
public interface CmsExamCountMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(CmsExamCount record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(CmsExamCount record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    CmsExamCount selectByPrimaryKey(Integer id);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(CmsExamCount record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(CmsExamCount record);

    /**
     * 单题打分
     * @param questionId
     * @param score
     * @return
     */
    int setScore(Integer questionId, Integer score);

    /**
     * 计算总分
     * @param studentId
     * @param paperId
     * @return
     */
    List<CmsExamCount> getSumScore(Integer studentId, Integer paperId);


}